package com.hdax.dm.api.item.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hdax.dm.api.item.ItemControllerApi;
import com.hdax.dm.entity.item.Item;
import com.hdax.dm.entity.item.ItemComment;
import com.hdax.dm.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ItemController implements ItemControllerApi {

    @Autowired
    private ItemService itemservice;

    @Override
    public List<Item> items(Long itemType1Id) {
        return itemservice.hotItems(itemType1Id);
    }

    @Override
    public Item itemDesc(Long itemId) {
        /*QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",itemId);
        return itemservice.getOne(queryWrapper);*/
        Item item = itemservice.itemDesc(itemId);
        return item;
    }

    @Override
    public List<Item> recommend() {
        return itemservice.recommend();
    }

    @Override
    public List<Item> sell() {
        return itemservice.sell();
    }

    @Override
    public List<Item> floors(Long itemType1Id) {
        return itemservice.floors(itemType1Id);
    }

    @Override
    public List<Item> seniority(Long itemType1Id) {
        return itemservice.seniority(itemType1Id);
    }

    @Override
    public List<Item> guesslike(Long itemTypeId) {
        return itemservice.guesslike(itemTypeId);
    }

    @Override
    public List<Item> getRecommend(Long itemTypeId) {
        return itemservice.getRecommend(itemTypeId);
    }

    @Override
    public List<Item> getWonderfulData(Long itemTypeId) {
        return itemservice.getWonderfulData(itemTypeId);
    }

    @Override
    public List<Item> getAdimgUrl(Long itemTypeId) {
        return itemservice.getAdimgUrl(itemTypeId);
    }

    @Override
    public List<Item> getCarouselData(Long itemTypeId) {
        return itemservice.getCarouselData(itemTypeId);
    }

    @Override
    public List<Item> getPopularSearch(Long itemTypeId) {
        return itemservice.getPopularSearch(itemTypeId);
    }

    @Override
    public List<Item> getParentChild(Long itemTypeId, Long ageGroup, Long limit) {
        return itemservice.getParentChild(itemTypeId, ageGroup, limit);
    }

    @Override
    public List<Item> getCalendarData(Long itemTypeId) {
        return itemservice.getCalendarData(itemTypeId);
    }
}
